package com.lgj.exception;

import com.lgj.result.ResultCode;

/**
 * @author: guangjie.liao
 * @Date: 2022/10/29 09:33
 * @Description:
 */
public class BusinessException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    private Object object;

    private ResultCode resultCode;

    public BusinessException(String msg) {
        super(msg);
    }

    public BusinessException(String msg, Object object) {
        super(msg);
        this.object = object;
    }

    public BusinessException(String msg, Throwable cause) {
        super(msg, cause);
    }


    public BusinessException(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
    }

    public BusinessException(ResultCode resultCode, Object object) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
        this.object = object;
    }

    public BusinessException(ResultCode resultCode, String message) {
        super(message);
        this.resultCode = resultCode;
    }


    public Object getObject() {
        return object;
    }

}
